<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:bs="http://none.cz">
<head th:substituteby="common/layout::header">
	<meta charset="utf-8" />
	<link rel="stylesheet" type="text/css" href="../../../resources/css/bootstrap.min.css" />
	<link rel="stylesheet" type="text/css" href="../../../resources/css/bootstrap-responsive.min.css" />
	<link rel="stylesheet" type="text/css" href="../../../resources/css/content.css" />
</head>
<body>
	<div th:substituteby="common/layout::menu"></div>
	<div class="container">
		<div th:include="common/layout::messages"></div>
		<form action="?" th:action="@{/catalog/edit}" th:object="${form}" method="post" class="form-standard form-horizontal">
			<fieldset>
				<legend th:text="#{catalog.edit.h1}">Edit place</legend>
	
				<input type="hidden" id="referer" name="referer" th:field="*{referer}"/>
				<input type="hidden" id="id" name="id" th:field="*{id}"/>
	
				<div class="control-group" th:attrappend="class=${#fields.hasErrors('name')}? ' error'">
					<label class="control-label" for="name" th:text="#{catalog.edit.name}">Name</label>
					<div class="controls">
						<input class="input-block-level" type="text" name="name" id="name" th:field="*{name}" />
					</div>
				</div>
	
				<div class="control-group" th:attrappend="class=${#fields.hasErrors('axisx')}? ' error'">
					<label class="control-label" for="axisx" th:text="#{catalog.edit.axisx}">AxisX</label>
					<div class="controls">
						<input class="input-block-level" type="text" name="axisx" id="axisx" th:field="*{axisx}" />
					</div>	
				</div>
	
				<div class="control-group" th:attrappend="class=${#fields.hasErrors('axisy')}? ' error'">
					<label class="control-label" for="axisy" th:text="#{catalog.edit.axisy}">Axisy</label>
					<div class="controls">
						<input class="input-block-level" type="text" name="axisy" id="axisy" th:field="*{axisy}" />
					</div>	
				</div>
				
				<div class="control-group" th:attrappend="class=${#fields.hasErrors('type')}? ' error'"><label class="control-label" for="type" th:text="#{catalog.edit.type}">Type</label>
					<div class="controls">
						<select name="type" id="type" th:field="*{type}" th:remove="all-but-first">
							<option value="1" th:each="type : ${allTypes}" th:value="${type}" th:text="#{${'place.types.' + type}}">Gasstation</option>
							<option value="2">Hotel</option>
						</select>
					</div>
				</div>	
				<div class="control-group" th:attrappend="class=${#fields.hasErrors('description')}? ' error'"><label class="control-label" for="description" th:text="#{catalog.edit.description}">description</label>
					<div class="controls">
						<textarea rows="10" name="description" id="description" th:field="*{description}">
						</textarea>
					</div>
				</div>	
				<div class="controls">
					<button th:text="#{form.submit}" name="_submit" class="btn btn-primary" type="submit" value="submit">Save</button>
					<button th:text="#{form.cancel}" name="_submit" class="btn" type="submit" value="cancel">Cancel</button>
				</div>
			</fieldset>
		</form>
	</div>
	<div th:include="common/layout::js"></div>
</body>
</html>